﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace SRAGWMCLib
{
    public class LegendEntry
    {

        int _SymbologyStyle, _SymbologyWeight;
        Color _FillColor, _BorderColor;
        string _Tooltip;
        Filter _Filter;
        DataSource _DataSource;

        public int SymbologyStyle
        {
            get
            {
                return _SymbologyStyle;
            }
            set
            {
                _SymbologyStyle = value;
            }
        }

        public int SymbologyWeight
        {
            get
            {
                return _SymbologyWeight;
            }
            set
            {
                _SymbologyWeight = value;
            }
        }

        public string Tooltip
        {
            get
            {
                return _Tooltip;
            }
            set
            {
                _Tooltip = value;
            }
        }

        public Color FillColor
        {
            get
            {
                return _FillColor;
            }
            set
            {
                _FillColor = value;
            }
        }

        public Color BorderColor
        {
            get
            {
                return _BorderColor;
            }
            set
            {
                _BorderColor = value;
            }
        }

        public Filter Filter
        {
            get
            {
                return _Filter;
            }
            set
            {
                _Filter = value;
            }
        }

        public DataSource DataSource
        {
            get
            {
                return _DataSource;
            }
            set
            {
                _DataSource = value;
            }
        }

        public LegendEntry(int pSymbologyStyle, int pSymbologyWeight, Color pBorderColor, Color pFillColor, string pTooltip) 
        {

            _SymbologyStyle = pSymbologyStyle;
            _SymbologyWeight = pSymbologyWeight;
            _FillColor = pFillColor;
            _BorderColor = pBorderColor;
            _Tooltip = pTooltip;
                
        }

        public void SetDataSource(string pDBName, string pDB, string pTable, string[] pAtributes)
        {
            SRAGWMCLib.DataSource DS = new SRAGWMCLib.DataSource(pDBName,pDB, pTable, pAtributes);

            _DataSource = DS;
        }

        public void SetFilter(string pWhereClause, object[] pPoints, int pNumPairs, int pSpatialOperator)
        {
            SRAGWMCLib.Filter F = new SRAGWMCLib.Filter(pWhereClause, pPoints, pNumPairs, pSpatialOperator);

            _Filter = F;
        }
    }
}
